package com.example.eurekaconsumer.FallBack;

import com.example.eurekaconsumer.service.FeignTestService;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @title: FeignTestServiceFallback
 * @projectName demo
 * @Date: 2021/5/23 20:29
 * @Author: lei.yu-esint
 * @Description:
 */
public class FeignTestServiceFallbackFactory implements FallbackFactory<FeignTestService>{

    @Override
    public FeignTestService create(Throwable throwable){

        return new FeignTestService(){
            @Override
            public String hello(){
                return "熔断";
            };

            @Override
            public List Index(){
                List list=new ArrayList();
                return list;
            };
        };
    }
}
